home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-01-28 | 1.1 KB | 70 lines | [TEXT/MPS ] |
-
- /*
- File: DebugTrace.cp
-
- Contains: Debug helper implementation.
-
- Developed by:
-
- Paul G Smith (commstalk hq & Full Moon Software, Inc)
-
- you can leave messages at (UK): 0727 844232; (US): 408 253 7199
- BUT I prefer to be contacted by e-mail
- AppleLink: SMITH.PG
- Internet: SMITH.PG@applelink.apple.com
-
- "SimpliFace" Sample code to accompany develop article
- on techniques for embedding scripts in applications.
-
-
- To link the output of this file you need also to link with
- file "DebugTranscript.lib".
-
- */
-
- #include "Stdio.h"
- #include "DebugTrace.h"
-
-
- #pragma trace off
-
-
-
- // ------ debug helpers ----------------------------------
-
- extern "C" { // debug utility functions
- pascal void SetDebugLevel(short);
- pascal short GetDebugLevel(void);
- }
-
- static short gOldDebugLevel;
- static short gWasDebugLevel;
-
-
- void SuspendDebug(void)
- {
- gWasDebugLevel = GetDebugLevel();
- SetDebugLevel(-2);
- }
-
-
- void ResumeDebug(void)
- {
- SetDebugLevel(gWasDebugLevel);
- }
-
-
- void ForceDebug(void)
- {
- gOldDebugLevel = GetDebugLevel();
- SetDebugLevel(1);
- }
-
-
- void EndForceDebug(void)
- {
- fflush(stdout);
- SetDebugLevel( -2 /* gOldDebugLevel */ );
- }
-
-